home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d19 / cntm095b.arc / COUNTEM.DOC < prev    next >
Text File  |  1991-10-03  |  13KB  |  377 lines

  1.  
  2.  
  3.  
  4.  
  5.            ╓─────╖                       ╥─────╖
  6.            ║                             ║
  7.            ║       ╓──╖ ╥  ╥ ╓─╖ ╥ ╓─╥─╖ ╟──     ╓─╥─╖    ║
  8.            ║       ║  ║ ║  ║ ║ ║ ║   ║   ║       ║ ║ ║    ║
  9.            ╙─────╜ ╙──╜ ╙──╜ ╨ ╙─╜   ╨   ╨─────╜ ╨ ╨ ╨    o
  10.  
  11.  
  12.                              Version 0.95ß
  13.  
  14.  
  15.  
  16.  
  17.                PCBoard 14.5a Directory Header Generator
  18.  
  19.  
  20.  
  21.  
  22.                    Copyright 1991 by Michael Nelson
  23.  
  24.                          Sysop of SeaHunt BBS
  25.  
  26.                 FidoNet 1:125/20 and RBBSNet 8:914/501
  27.  
  28.                             October 3, 1991
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.     CountEm  started  as  a  utility  to  generate  summaries  of   your
  36. downloadable  files  directories.  With  the  release  of version 0.95ß,
  37. CountEm will also  produce graphic header  files for the  individual DIR
  38. files.  Written in  Borland C, CountEm is  VERY fast!!  On  my system (a
  39. 386/33 with 2  megs of HyperDisk  Cache, over 3200  files totalling over
  40. 240 megs), CountEm does all this in approximately six seconds!
  41.  
  42.     CountEm uses a small configuration file to allow you to  personalize
  43. the colors and the way your BBS's name is displayed in the headers.   It
  44. gets most of the information it needs, however, directly from  PCBoard's
  45. system  files  PCBOARD.DAT,  CNAMES.@@@,  and  DIR.LST.   In doing this,
  46. several assumptions are made:
  47.  
  48.     1)  Although  CountEm  opens  the  PCBoard  system  files  in  SHARE
  49. compatible mode, and CountEm does  not write to any system  files except
  50. the DIR files themselves, you should still make sure all nodes are  DOWN
  51. prior to running CountEm.  If a caller is on and that caller is  reading
  52. a DIR  file when  CountEm attempts  to write  to it,  you'll get a SHARE
  53. violation, (assuming  you have  SHARE.EXE loaded).   If you  DON'T  have
  54. SHARE loaded, bad things could happen.   So, the moral of the story  is,
  55. make sure all nodes are DOWN prior to running CountEm.
  56.  
  57.     2) There  isn't much  error checking  on the  COUNTEM.CFG file.   An
  58. example COUNTEM.CFG file is included in this archive.  Please modify  it
  59. to suit  your needs.   As long  as you  use an  ASCII text  file  editor
  60. (QEdit  works  fine,  I  use  Brief  and MultiEdit), and don't do stupid
  61. things  like  putting  in  a  255  character  name for your BBS, nothing
  62. should go  wrong.   Make SURE  the format  of your  finished file is the
  63. same as in the example file.
  64.  
  65.     3) When changing the colors, please make sure you use VALID  PCBoard
  66. 14.5  color  codes.   If  you  don't,  the  program  will,  most likely,
  67. misbehave.  There is NO error checking  on the color codes.  If you  put
  68. in valid  codes, you'll  get valid  colors.   On the  next page  of this
  69. document is an excerpt from Clark Development Corp's bulletin  "X-CODES"
  70. (available from SaltAir), showing the valid color codes.
  71.  
  72.  
  73.  
  74.                      -=- PCBoard Color Codes -=-
  75.  
  76.     The @x-color codes correspond to your regular PC display codes.
  77.  
  78.     For instance, a 1 is blue, a 2 is green a 3 is cyan and so on.
  79.  
  80.     The same  numbers are  used for  background colors  except that they
  81. are shifted left four  bits (to the upper  "nibble" of the byte  if that
  82. means anything to you).   It's easy to picture  when you think of  it in
  83. HEX rather than decimal numbers like this:
  84.  
  85.     Background (first digit)      Foreground (second digit)
  86.     ------------------------      -------------------------
  87.     Black   =  0                   Black   =  0
  88.     Blue    =  1                   Blue    =  1
  89.     Green   =  2                   Green   =  2
  90.     Cyan    =  3                   Cyan    =  3
  91.     Red     =  4                   Red     =  4
  92.     Magenta =  5                   Magenta =  5
  93.     Yellow  =  6                   Yellow  =  6
  94.     White   =  7                   White   =  7
  95.  
  96.     Background w/Blinking          High Intensity Foregounds
  97.  
  98.     Black   =  8                   Black   =  8
  99.     Blue    =  9                   Blue    =  9
  100.     Green   =  A                   Green   =  A
  101.     Cyan    =  B                   Cyan    =  B
  102.     Red     =  C                   Red     =  C
  103.     Magenta =  D                   Magenta =  D
  104.     Yellow  =  E                   Yellow  =  E
  105.     White   =  F                   White   =  F
  106.  
  107. Examples:
  108.     Bright White on Blue Background        = 1F  (1=blue,F=white)
  109.     Bright Yellow on Green Background      = 2E  (2=green,E=yellow)
  110.     Dark Blue blinking on White Background = F1  (F=white,1=blue)
  111.  
  112.     See how  the number  in the  left colomn  represents the  background
  113. while the number  in the right  column represents the  foreground?  That
  114. is a whole  lot easier to  remember than to  think of "blue  background"
  115. being equal to 16, "green background" equal to 32 and "cyan  background"
  116. equal to 48 which is what you'd have in decimal.
  117.  
  118.  
  119.  
  120.     Combining colors  then is  much easier  to visualize  as well  - for
  121. instance YELLOW foreground on a BLUE background would be:
  122.  
  123.         1E   - where 1=BLUE and E=bright yellow
  124.  
  125.     Instead of thinking of yellow on  blue as being the number 30  which
  126. doesn't make any sense at all.
  127.  
  128.     Okay, now to practice what we've learned:
  129. @X00
  130.         @x1E = @X1EYELLOW ON BLUE@XFF
  131.         @x2F = @X2FWHITE ON GREEN@XFF
  132.         @x31 = @X31BLUE ON CYAN@XFF
  133.  
  134.  
  135.  
  136. The COUNTEM.CFG file:
  137. ---------------------
  138.  
  139.     The format  of COUNTEM.CFG  is critical  to your  success in running
  140. the program.  Here's what a sample COUNTEM.CFG looks like:
  141.  
  142. C:\PCB
  143. S e a H u n t  B B S
  144. @X06
  145. @X0D
  146. @X0F
  147. @X0B
  148. @X07
  149. @X0E
  150. @X0E
  151. @X0F
  152. @X03
  153. @X0B
  154. @X03
  155. ;------------------------------------------------------------------
  156. ;                       CountEm Configuration File
  157. ;                          for CountEm v0.95ß
  158. ;
  159. ; Notes:
  160. ;       You can put comments in this file, as long as they are below the
  161. ;       dashed line above, and as long as they have a semicolon in column
  162. ;       number 1.
  163. ;
  164. ;       There should be NO BLANK LINES in this file
  165. ;
  166. ;       CountEm v0.92ß requires the addition of line 13!!
  167. ;
  168. ;
  169. ; Line 1:       Path to PCBOARD.DAT file (no trailing backslash, pls!!)
  170. ; Line 2:       BBS Name for DIR header
  171. ; Line 3:       Line drawing character color
  172. ; Line 4:       BBS Name color
  173. ; Line 5:       DIR Title color
  174. ; Line 6:       Header color
  175. ; Line 7:       Normal color (default is X07, light grey on black)
  176. ; Line 8:       Directory Number color
  177. ; Line 9:       Conference Name color
  178. ; Line 10:      Directory Description color
  179. ; Line 11:      File Count Color
  180. ; Line 12:      File Size Color
  181. ; Line 13:      TimeStamp Color (NEW in v0.92ß)
  182.  
  183.  
  184. Preparing to use CountEm:
  185. -------------------------
  186.  
  187.     After modifying COUNTEM.CFG, you'll need to use either  PCBFILER.EXE
  188. or  an  ASCII  text  editor  to  modify  your  DIRn  files.   With   the
  189. introduction of PCBoard 14.5A,  Clark Development Corporation (CDC)  has
  190. given  PCBoard  the  capability  to  display  a file from within another
  191. file.  This is the method  CountEm uses to display the directory  header
  192. files.
  193.  
  194.     Break out  your editor,  and let's  go to  work on  your DIRn files.
  195. First, you  need to  determine where  they are  located.   The   default
  196. PCBoard setup program puts them in C:\PCB\GEN.  If you don't know  where
  197. they are located, you can find them by using PCBSetup.
  198.  
  199.     Once you've found them, load them,  one by one, into your editor  or
  200. PCBFiler.  We'll use my DIR12 file as an example.  You need to trim  any
  201. lines above the  first filename line  off, and insert  a line that  says
  202. something like:
  203.  
  204. %c:\pcb\gen\dir12.hdr
  205.  
  206.     The above  line is  what you  would add  as the  first line  of your
  207. DIR12 file.   The header file  generated by CountEm  is DIR12.HDR.   You
  208. need to have this line  at the top of each  DIR file, as line 1,  and it
  209. needs to start in column one.   When PCBoard goes to display DIR12,  the
  210. first  thing  it  sees  is  "%c:\pcb\gen\dir12.hdr".   That  tells it to
  211. display that filename BEFORE displaying  DIR12.  Don't forget to  put it
  212. as the FIRST line  of the DIR file,  and make sure the  "%" character is
  213. there in column 1.
  214.  
  215.     There  should  NOT  be  a  blank  line  below the above line.  After
  216. editing DIR12, the first two lines of the file will look something  like
  217. this:
  218.  
  219. %c:\pcb\gen\dir12.hdr
  220. 24UP.ZIP        42452  01-18-91  Compressed file printing with HP LJII
  221.  
  222.     You'll need to do this just once for each DIRn file on your  system.
  223. I realize it's a pain, but CountEm won't work right without this step!!
  224.  
  225.  
  226. Running CountEm:
  227. ----------------
  228.  
  229.     Don't  worry...  if  you've  gotten  this  far,  you're almost done!
  230. Running CountEm is  simple.  You  can run it  from the DOS  prompt (make
  231. sure all  nodes are  down first),  by changing  into the directory where
  232. CountEm.exe and  CountEm.cfg are  located (BTW,  they need  to be in the
  233. same directory... I just put 'em in C:\PCB), and then typing:
  234.  
  235.             COUNTEM COUNTEM.CFG
  236.  
  237.  
  238. ErrorLevels:
  239. ------------
  240.  
  241.     To make  usage in  batch files  more convenient,  CountEm will  exit
  242. with various different  "errorlevels".  An  errorlevel of "0"  indicates
  243. that the program exited normally.  Any other errorlevel returned by  the
  244. program indicates  a problem  of one  sort or  another.  The errorlevels
  245. returned by CountEm are:
  246.  
  247.         99 = Error Opening a File
  248.         98 = Syntax Error - Bad Command Line
  249.         97 = Error Closing a File
  250.         96 = Error Reading a File
  251.         95 = Too Many Conferences to Process
  252.         94 = Too Many Directories to Process
  253.         93 = Unable to Allocate Required Memory
  254.          0 = Normal Exit
  255.  
  256.     So,  you  can  trap  these  errorlevels  in  a  batch  file and take
  257. appropriate  action  if  something  goes  wrong.   Proper  trapping   of
  258. errorlevels in your  batch file should  help you sleep  better at night!
  259. There's a sample batch file you might call CNT.BAT on the next page.
  260.  
  261.  
  262.  
  263.     Remember that you need to check errorlevels in descending order.   A
  264. typical batch file to run CountEm in your event might look like this:
  265.  
  266.     @ECHO OFF
  267.     C:
  268.     CD\PCB
  269.  
  270.     COUNTEM COUNTEM.CFG
  271.  
  272.     IF ERRORLEVEL 99 GOTO FILE
  273.     IF ERRORLEVEL 98 GOTO COMMAND
  274.     IF ERRORLEVEL 97 GOTO CLOSE
  275.     IF ERRORLEVEL 96 GOTO READ
  276.     IF ERRORLEVEL 95 GOTO CONF
  277.     IF ERRORLEVEL 94 GOTO DIRS
  278.     IF ERRORLEVEL 93 GOTO MEM
  279.     IF ERRORLEVEL 0  GOTO NORM
  280.  
  281.     :FILE
  282.         ECHO COUNTEM UNABLE TO OPEN FILE! > COUNTEM.LOG
  283.         GOTO END
  284.  
  285.     :COMMAND
  286.         ECHO COUNTEM SYNTAX ERROR! > COUNTEM.LOG
  287.         GOTO END
  288.  
  289.     :CLOSE
  290.         ECHO COUNTEM WAS UNABLE TO CLOSE A FILE! > COUNTEM.LOG
  291.         GOTO END
  292.  
  293.     :READ
  294.         ECHO COUNTEM WAS UNABLE TO READ A FILE! > COUNTEM.LOG
  295.         GOTO END
  296.  
  297.     :CONF
  298.         ECHO COUNTEM REPORTED TOO MANY CONFERENCES! > COUNTEM.LOG
  299.         GOTO END
  300.  
  301.     :DIRS
  302.         ECHO COUNTEM REPORTED TOO MANY DIRECTORIES! > COUNTEM.LOG
  303.         GOTO END
  304.  
  305.     :MEM
  306.         ECHO COUNTEM REPORTED MEMORY ALLOCATION ERROR! > COUNTEM.LOG
  307.         GOTO END
  308.  
  309.     :NORM
  310.         ECHO COUNTEM PROCESSING FINISHED NORMALLY > COUNTEM.LOG
  311.  
  312.     :END
  313.  
  314.  
  315.  
  316. Disclaimer:
  317. -----------
  318.  
  319.     This program is not  guaranteed to do anything  but occupy a bit  of
  320. space on your hard drive.   While it has been tested on  several PCBoard
  321. systems,  Michael  Nelson  can  not  be  held responsible for any damage
  322. CountEm may do to your system.
  323.  
  324.     If you can't live with the risk, delete the program, please.
  325.  
  326.  
  327. Tech Support:
  328. -------------
  329.  
  330.     If you have any problems,  or any suggestions for improvements,  you
  331. can contact me in several ways.
  332.  
  333.     1) I monitor most conferences on  SaltAir BBS, so if you leave  me a
  334. message there I will probably see it and respond to you.
  335.  
  336.     2) If  you are  in FidoNet  or RBBSNet,  you can  send me NetMail at
  337. either of the following addresses:
  338.  
  339.                 FidoNet 1:125/20
  340.                 RBBSNet 8:914/501
  341.  
  342.     3) You can log onto my BBS  and leave me a message.  SeaHunt  BBS is
  343. located  in  Burlingame,  California  (near  San  Francisco),  and is PC
  344. Pursuitable.  There are two nodes:
  345.  
  346.                 Node 1 - PRIVATE / SUBSCRIBERS 1-415-343-5904
  347.                          USR HST/DS v.32bis modem
  348.  
  349.                 Node 2 - PUBLIC  1-415-344-4348
  350.                          USR HST 14.4k modem
  351.  
  352.  
  353. Release History:
  354. ----------------
  355.  
  356. 9/29/91 v0.91ß      Initial wide beta release
  357.  
  358. 9/30/91 v0.92ß      Additional error  checking.  Changed  configuration
  359.                     file.  Added a timestamp to the header.
  360.  
  361. 10/1/91 v0.93ß      Not released
  362.  
  363. 10/3/92  v0.94ß     CountEm  was  not  properly  counting  lines  in
  364.                     instances     where     there     was     a   header
  365.                     containing line drawing  characters embedded in  the
  366.                     DIRn files.  Fixed.
  367.  
  368. 10/3/92 v0.95ß      Added the ability for CountEm to generate  graphical
  369.                     header  files   for  each   of  your   DIRn   files.
  370.                     Optimized  several  areas  of  the  code,  and   now
  371.                     CountEm does  this additional  work in  no more time
  372.                     than previous versions took to just do the summaries.
  373.  
  374.  
  375.  
  376.  
  377.